Skip to content

[fix][broker] fix topic policy is updated incorrectly when continuously use pulsar-admin to set policy#21026

Open
TakaHiR07 wants to merge 1 commit intoapache:masterfrom
TakaHiR07:fix_update_topicPolicy_error
Open

[fix][broker] fix topic policy is updated incorrectly when continuously use pulsar-admin to set policy#21026
TakaHiR07 wants to merge 1 commit intoapache:masterfrom
TakaHiR07:fix_update_topicPolicy_error

Conversation

@TakaHiR07
Copy link
Contributor

@TakaHiR07 TakaHiR07 commented Aug 18, 2023

Fixes #21024

Motivation

Modify the process of update topic policy.

Make topic policy can be updated correctly when user use pulsar-admin to set policy

Modifications

  1. Construct a new topicPolicy in internalSetRetention(), which make sure we do not update the value of policiesCache in two area. We only update policiesCache by SystemTopicBasedTopicPoliciesService#refreshTopicPoliciesCache
  2. All the method about update topicPolicy in pulsar-admin, should respond success to client after policy is actually updated in policiesCache.
  3. Retry in isRetentionUpdateSuccess(), because systemTopicReader maybe can not immediately read next PulsarEvent message.
  4. Improve the test in TopicPoliciesTest to make the test cover more complicated pulsar-admin operation.

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: TakaHiR07#13

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Aug 18, 2023
@codelipenghui codelipenghui added the type/bug The PR fixed a bug or issue reported a bug label Aug 21, 2023
@codelipenghui codelipenghui added this to the 3.2.0 milestone Aug 21, 2023
@TakaHiR07
Copy link
Contributor Author

All internalSetXXX and internalRemoveXXX method about topicPolicy should also be modified like internalSetRetention and internalRemoveRetention. I will modify them after review.

@codelipenghui codelipenghui added the category/reliability The function does not work properly in certain specific environments or failures. e.g. data lost label Aug 21, 2023
@github-actions
Copy link

The pr had no activity for 30 days, mark with Stale label.

@github-actions github-actions bot added the Stale label Sep 21, 2023
@Technoboy- Technoboy- modified the milestones: 3.2.0, 3.3.0 Dec 22, 2023
@coderzc coderzc modified the milestones: 3.3.0, 3.4.0 May 8, 2024
@lhotari lhotari modified the milestones: 4.0.0, 4.1.0 Oct 11, 2024
@coderzc coderzc modified the milestones: 4.1.0, 4.2.0 Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category/reliability The function does not work properly in certain specific environments or failures. e.g. data lost doc-not-needed Your PR changes do not impact docs Stale type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Topic policy is updated incorrectly when continuously use pulsar-admin to set policy

5 participants